package com.farmcode.console.api.model;

import com.farmcode.base.web.RowSelectedSpc;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;

@Entity
@Table(name="FC_PROPERTY")
public class Property extends RowSelectedSpc implements Serializable {
	//Fields
	@Id
	@Column(name="ID", unique=true, nullable=false, precision=18, scale=0)
        @GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	@ManyToOne
	@JoinColumn(name="PROJECT_ID", nullable=true)
	private Project project;
	@Column(name="NAME", unique=true, nullable=false, precision=50, scale=0)
	private String name;
	@Column(name="VALUE", unique=true, nullable=false, precision=200, scale=0)
	private String value;
	@Column(name="TYPE", unique=true, nullable=false, precision=1, scale=0)
	private String type;
	
	//Default Constructor
	public Property() {}
	//Constructor, Parameters
	public Property(Long id, String name, String value, String type){
		this.id = id;
		this.name = name;
		this.value = value;
		this.type = type;
	}
	//Getters and Setters
	public void setId(Long id){
		this.id = id;
	}
	public Long getId(){
		return this.id;
	}
	public void setProject(Project project){
		this.project = project;
	}
	public Project getProject(){
		return this.project;
	}
	public void setName(String name){
		this.name = name;
	}
	public String getName(){
		return this.name;
	}
	public void setValue(String value){
		this.value = value;
	}
	public String getValue(){
		return this.value;
	}
	public void setType(String type){
		this.type = type;
	}
	public String getType(){
		return this.type;
	}
	@Override
	public String toString(){
		return super.toString();
	}
	
	
}
